@extends("admin.frame_layout")
<?php $top_selected = "工作台";
if ($flag == 0) {
    $page_menu = "未处理申请单";
} elseif ($flag == 1) {
    $page_menu = "已处理申请单";
}
?>
@section('content')
    <div class="rightinfo">
        <div class="tools">
            <form method="get" id="sform" action="{{route('admin.remit',['flag'=>$flag])}}">
                <ul class="toolbar">
                    <li>
                        <select name="time_type">
                            <option value="create_time">申请时间</option>
                            <option value="pay_time">打款时间</option>
                            <option value="deal_time">处理时间</option>
                        </select>
                    </li>
                    <li>
                        <input type="text" name="start" placeholder="开始时间"
                               onClick="laydate({istime: true,format: 'YYYY-MM-DD hh:mm:ss'})">
                    </li>
                    <li>
                        <input type="text" name="end" placeholder="结束时间"
                               onClick="laydate({istime: true,format: 'YYYY-MM-DD hh:mm:ss'})">
                    </li>
                    <li>
                        <select name="search_type">
                            <option value="1">打款申请编号</option>
                            <option value="2">打款申请ID</option>
                            <option value="3">用户名</option>
                            <option value="4">注册手机号</option>
                            <option value="5">会员编号</option>
                            <option value="6">真实姓名</option>
                            <option value="7">支付宝账号</option>
                            <option value="8">微信账号</option>
                            <option value="9">银行卡号</option>
                        </select>
                    </li>
                    <li>
                        <input id="search_str" name="search_str" type="text" placeholder="搜索条件">
                    </li>
                    <li>
                        <a href="javascript:void(0)" onclick="$('#sform').submit()">
                            <span><img src="{{asset('admin/imgs/ico06.png')}}" width="20px"
                                       height="20px"/></span>搜索
                        </a>
                    </li>
                </ul>
            </form>
        </div>

        <table class="tablelist">
            <thead>
            <tr>
                <th width="70px">操作</th>
                <th width="80px">ID<i class="sort"><img src="{{asset('admin/imgs/px.gif')}}"/></i></th>
                <th width="100px">编号<i class="sort"><img src="{{asset('admin/imgs/px.gif')}}"/></i></th>
                <th>用户名</th>
                <th>真实姓名</th>
                <th>注册手机号</th>
                <th>充值类型</th>
                <th>打款金额</th>
                <th>打款方式</th>
                <th>帐号信息</th>
                <th>联系方式</th>
                <th>会员编号</th>
                <th>申请时间</th>
                <th>打款时间</th>
                <th>处理时间</th>
                <th style="text-align: left;">处理结果</th>
                <th style="text-align: left;">状态</th>
            </tr>
            </thead>
            <tbody>
            @foreach($remitLogs as $log)
                <tr>
                    <td class="act" bind="#{{$log->id}}">
                        <img src="{{asset('admin/imgs/t05.png')}}"/>菜单
                        @if($flag == 0)
                            <ul id="{{$log->id}}">
                                <li onclick="openAllowDlg({{$log->id}})">
                                    <img src="{{asset('admin/imgs/d02.png')}}"/>通过申请
                                </li>
                                <li onclick="openDenyDlg({{$log->id}})">
                                    <img src="{{asset('admin/imgs/d02.png')}}"/>拒绝打款
                                </li>
                            </ul>
                        @endif
                    </td>
                    <td>{{$log->id}}</td>
                    <td>{{$log->no}}</td>
                    <td>{{$log->username}}</td>
                    <td>{{$log->realname}}</td>
                    <td>{{$log->user->mobile}}</td>
                    <td>{{ uWalletStr($log->wallet) }}</td>
                    <td>{{$log->money}}</td>
                    <td>
                        @if($log->type == \App\Models\MWithdrawLog::$PAY_TYPE_YHK)
                            银行卡
                        @elseif($log->type == \App\Models\MWithdrawLog::$PAY_TYPE_ZFB)
                            支付宝
                        @elseif($log->type == \App\Models\MWithdrawLog::$PAY_TYPE_WX)
                            微信
                        @endif
                    </td>
                    <td>
                        @if($log->type==\App\Models\MWallet::$PAY_TYPE_ZFB)
                            支付宝账号：{{$log->zfb}}
                        @elseif($log->type==\App\Models\MWallet::$PAY_TYPE_WX)
                            微信账号：{{$log->wx}}
                        @elseif($log->type==\App\Models\MWallet::$PAY_TYPE_YHK)
                            银行：{{$log->card_bank}}&nbsp;&nbsp;开户人：{{$log->card_name}}&nbsp;&nbsp;卡号：{{$log->card_no}}
                        @endif
                    </td>
                    <td>{{$log->tel}}</td>
                    <td style="color: red">{{$log->user->no}}</td>
                    <td>{{date("Y-m-d H:i:s",$log->create_time)}}</td>
                    <td>{{$log->pay_time==''?'无':date("Y-m-d H:i:s",$log->pay_time)}}</td>
                    <td>{{$log->deal_time==''?'无':date("Y-m-d H:i:s",$log->pay_time)}}</td>
                    <td>{{$log->result==''?'无':$log->result}}</td>
                    <td>
                        @if($log->status ==1)
                            <a href="###" style="color: blue">待审核</a>
                        @elseif($log->status ==2)
                            <a href="###" style="color: green">充值成功</a>
                        @elseif($log->status==3)
                            <a href="###" style="color: red">已拒绝</a>
                        @endif
                    </td>
                </tr>
            @endforeach
            </tbody>
        </table>
        @include('admin.coms.fenye')
    </div>
    @include('admin.coms.allow-remit')
    @include('admin.coms.deny-remit')
@endsection
@section('footer')
    <script src="{{asset('admin/js/laydate/laydate.js')}}"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            laydate.skin("dahong"); //大红色日期选择皮肤
            //初始化表格操作菜单
            $('.tablelist tbody tr:odd').addClass('odd');
            $(".tablelist .act").hover(function () {
                $($(this).attr("bind")).show();
            }, function () {
                $($(this).attr("bind")).hide();
            });
        });
    </script>
@endsection

